﻿<Page x:Class="SocialApi.TestApp.Views.IntagramControl"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
      xmlns:converters="clr-namespace:SocialApi.TestApp.Converters">
    <Page.Resources>
        <converters:BoolConverter x:Key="BoolConverter" />
    </Page.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <DockPanel Margin="15"
                   Grid.Row="0">
            <TextBlock Text="URL:"
                       FontWeight="Bold"
                       DockPanel.Dock="Left" />
            <Button Content="Отправить"
                    DockPanel.Dock="Right"
                    Command="{Binding SendCommand}" />
            <TextBox Text="{Binding Url, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
                     IsReadOnly="True"
                     Margin="5,0,5,0" />
        </DockPanel>
        <GroupBox Header="Параметры"
                  Margin="15"
                  Grid.Row="1">
            <StackPanel Orientation="Vertical"
                        Margin="5">
                <StackPanel Orientation="Vertical"
                            Margin="0,0,0,5">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding UserIdText}"
                                   Width="120" />
                        <TextBox Text="{Binding UserId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                 Width="120"
                                 Margin="5,0,0,0" />
                        <TextBlock Text="{Binding UserId2Text}"
                                   Margin="15,0,0,0"
                                   Width="120" />
                        <TextBox Text="{Binding UserId2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                 Width="120"
                                 Margin="5,0,0,0" />
                        <TextBlock Text="{Binding MediaIdText}"
                                   Margin="15,0,0,0"
                                   Width="80" />
                        <TextBox Text="{Binding MediaId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                 Width="120"
                                 Margin="5,0,0,0" />
                    </StackPanel>
                </StackPanel>
                <StackPanel Orientation="Vertical"
                            Margin="0,0,0,5">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding TagNameText}"
                                   Width="120" />
                        <TextBox Text="{Binding TagName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                 Width="120"
                                 Margin="5,0,0,0" />
                        <TextBlock Text="{Binding LocationIdText}"
                                   Margin="15,0,0,0"
                                   Width="120" />
                        <TextBox Text="{Binding LocationId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                 Width="120"
                                 Margin="5,0,0,0" />
                        <TextBlock Text="{Binding DistanceText}"
                                   Margin="15,0,0,0"
                                   Width="80" />
                        <TextBox Text="{Binding Distance, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                 Width="120"
                                 Margin="5,0,0,0" />
                    </StackPanel>
                </StackPanel>
                <StackPanel Orientation="Vertical"
                            Margin="0,0,0,5">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding MinTimeText}"
                                   Width="120" />
                        <xctk:DateTimePicker Text="{Binding MinTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                             TimeFormat="LongTime"
                                             Width="120"
                                             Margin="5,0,0,0" />
                        <TextBlock Text="{Binding MaxTimeText}"
                                   Margin="15,0,0,0"
                                   Width="120" />
                        <xctk:DateTimePicker Text="{Binding MaxTime, Mode=TwoWay}"
                                             TimeFormat="LongTime"
                                             Margin="5,0,0,0"
                                             Width="120" />
                        <TextBlock Text="{Binding LngText}"
                                   Margin="15,0,0,0"
                                   Width="80" />
                        <TextBox Text="{Binding Lng, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                 Width="120"
                                 Margin="5,0,0,0" />
                    </StackPanel>
                </StackPanel>
                <StackPanel Orientation="Vertical"
                            Margin="0,0,0,5">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding LatText}"
                                   Width="120" />
                        <TextBox Text="{Binding Lat, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                 Width="120"
                                 Margin="5,0,0,0" />
                        <TextBlock Text="{Binding SearchText}"
                                   Margin="15,0,0,0"
                                   Width="120" />
                        <TextBox Text="{Binding Search, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                 Width="120"
                                 Margin="5,0,0,0" />
                    </StackPanel>
                </StackPanel>
            </StackPanel>
        </GroupBox>
        <GroupBox Header="Стиль запросов"
                  Grid.Row="2"
                  Margin="15">
            <StackPanel Margin="5">
                <RadioButton Content="Синхронный"
                             IsChecked="{Binding IsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                             GroupName="RequestType" />
                <RadioButton Content="Асинхронный"
                             IsChecked="{Binding IsAsyncSync, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource BoolConverter}}"
                             GroupName="RequestType" />
            </StackPanel>
        </GroupBox>
        <TextBox Text="{Binding Result, Mode=TwoWay}"
                 IsReadOnly="True"
                 VerticalScrollBarVisibility="Auto"
                 HorizontalScrollBarVisibility="Auto"
                 Margin="15"
                 Grid.Row="3" />
    </Grid>
</Page>